package com.ushine.design.design.c_behavioral_pattern.g_observer.b_example;

public class Client {
    public static void main(String[] args) {
        //定义观察者目标对象
        AllyControlCenter acc;
        acc = new ConcreteAllyContolCenter("金庸武侠");

        //定义4个观察者对象
        Observer player01, player02, player03, player04;

        player01 = new Player("杨过");
        acc.join(player01);

        player02 = new Player("灵狐冲");
        acc.join(player02);

        player03 = new Player("张无忌");
        acc.join(player03);

        player04 = new Player("段誉");
        acc.join(player04);

        //某成员遭受攻击
        player01.beAttacked(acc);
    }
}
